package com.bawei.jetpackdemo;

import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * @Author : yaotianxue
 * @Time : On 2023/9/11 09:07
 * @Description : MyListener
 */
public class MyListener implements LifecycleObserver {
    private static final String TAG = "MyListener";

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void create(){
        Log.d(TAG, "create: ");
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    public void start(){
        Log.d(TAG, "start: ");
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public void resume(){
        Log.d(TAG, "resume: ");
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void pause(){
        Log.d(TAG, "pause: ");
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void stop(){
        Log.d(TAG, "stop: ");
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    public void destroy(){
        Log.d(TAG, "destroy: ");
    }

}
